home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
DB_CLIPP
/
0669.ZIP
/
UDF_HELP.LOG
< prev
next >
Wrap
Internet Message Format
|
1987-04-05
|
7KB
Date: 01-23-87 (17:09) Number: 1150
To: ALL Refer#: None
From: RUSS NELSON Recv'd: (n/a)
Subj: DATA ENTRY HELP AIDS Sec'ty: Public Message
I'm trying to develop an algorithm that will place a brief description
of each data entry field on the screen as the cursor is on the field.
I've found a so-so solution which works but doesn't seem too effecient.
My solution is:
STORE 'THE MESSAGE' TO HLP_001
ECT...
STORE '001' TO FIRST,COUNTER
STORE '021' TO LAST
@ 3,8 GET ACCT
@ 22,0 CLEAR
@ 22,(80-LEN(HLP_&COUNTER))/2 SAY HLP_&COUNTER
READ
IF READKEY() > 0 .AND. COUNTER<LAST
STORE ( STR( &COUNTER + 1001,4) ,2,3) TO COUNTER
ENDIF
AND SO ON FOR EACH @ROW,COL GET FIELD STATEMENT
There must be a better way. Any suggestions would be greatly
appreciated. Thanks.
Date: 01-23-87 (22:09) Number: 1151
To: RUSS NELSON Refer#: 1150
From: SYSOP Recv'd: No
Subj: DATA ENTRY HELP AIDS Sec'ty: Public Message
Making a routine similar to the one you described a procedure and DOing
the procedure each time you wanted to print the help line would reduce
the lines of code, but would not be any more efficient is execution.
CLIPPER has a built in help facility that is automatically called with
the F1 key. It could be adapted to you needs.
Date: 01-24-87 (01:32) Number: 1152
To: RUSS NELSON Refer#: 1150
From: BILL CASTNER Recv'd: No
Subj: DATA ENTRY HELP AIDS Sec'ty: Public Message
You need Clipper by Nantucket. The VALID option in combination with
UDFs -- User Defined functions-- would let you do this. An untested
but promising solution is from Communications Horizons, that lets
you use UDFs (they say) in Dbase. But without the VALID feature as
a trigger, I think you are out of luck even with this software
aid. Sorry, but Dbase III is very limited in terms of what it
offers in terms of our desired screen display. But you could do
it in Clipper without sweat. Bill.
Date: 01-27-87 (13:03) Number: 1158
To: RUSS NELSON Refer#: 1150
From: JOHN KASTER Recv'd: No
Subj: DATA ENTRY HELP AIDS Sec'ty: Public Message
Russ, are you doing strictly a dBASE application? Whether you are or
not, one possible method is to have a file indexed on the field name you
are "GET"ting. Temporarily use that file, seek the description for that
file name, and write it where you are. There's a good way to make that
into a function from CLIPPER if you have it. Let me know - I can give
you example source code.
John Kaster
Date: 01-27-87 (14:01) Number: 1160
To: BILL CASTNER Refer#: None
From: STEVE ANDERSON Recv'd: Yes
Subj: DATA ENTRY HELP LINES Sec'ty: Public Message
A brief example of how you would use Clipper UDF's and VALID would be
helpfull to me. I am just learning Clipper. I also like the idea of
having help lines with each get statement. Thanks,
Date: 01-27-87 (00:13) Number: 1163
To: STEVE ANDERSON Refer#: 1160
From: BILL CASTNER Recv'd: Yes
Subj: DATA ENTRY HELP LINES Sec'ty: Public Message
There are several kinds of help lines possible with Clipper:
Type One: Displayed concurrently with the GET
Type Two: Displayed if a response is incorrect to a GET
Type Three: Displayed if a user needs some help and requests it
For Type One help displays, the easiest way, I think, is
using a UDF in the VALID option of the get. By trapping the
LASTKEY() .and. READVAR() you can tell what the next GET will
be, and display some text message before returning from the
VALID clause. I will try and look up a code example from one
of my programs and leave it here in the next day or so.
For type Two, the message is displayed if a GET value is
inappropriate, and the VALID clause and UDF is straightforward:
@ x,y say 'Enter Registration Code' get mregcode valid
udfregcode(mregcode)
* lets assume you want the message to display at 24,5
* the following would be located somewhere in the .prg file:
function udfregcode
parameter cstring
* allowable codes are A,B,C and D
if cstring $ 'ABCD'
return .t. && no need for a help display
endif
* incorrect value--tell user about it
@ 24,5 say 'Allowable Registration Codes are A,B,C,D. Try again.'
return .f.
******End of Function regcode
For type Three, the Clipper Help.Prg would allow someone to strike
F1 at any point and get a help listing, which could be made context
specific using the PROCNAME(), and READVAR() functions in particular
to allow you to vector to an appropriate bit of text to display.
.
An excellent article covering many of these topics, with examples of
what I am calling Type Three help, is 'User Defined Validation and
Context Specific Help;, J. Ari Kornfeld, Data Based Advisor,
Vol. 4, #12, December 1986, p.4
.
One final note, you can mesh types two and three help systems together
by using the KEYBOARD command. If in the UDF udfregcode above
I had put the line KEYBOARD CHR(28) in place of the @ 24,5 say stuff,
the help system would be called automatically when the UDF returned
to the calling GET line. (As key value 28 is the F1 key to
Clipper).
Date: 01-29-87 (02:11) Number: 1164
To: STEVE ANDERSON Refer#: 1160
From: BILL CASTNER Recv'd: Yes
Subj: DATA ENTRY HELP LINES Sec'ty: Public Message
Because the example is lengthy, I am uploading it to the new files
section as GETSHELP.ARC. This includes a GETSKEYS.PRG file that
you can compile to get a demonstration, and a GETSKEYS.TXT file
that offers some notes and coding alternatives.
What the example shows is two types on in-line context specific
help during READs. One type displays a help line for each
get that is GET specific. That, I think, was your real quest. The
second type of help does this too, but if an invalid entry is made
it displays context-specific error messages. Look over the code.
There is a lot to be said for writing data entry screens that
provide in-line help at the bottom of the screen, rather than
just (aren't we Clippers getting jaded?) allowing an F1 key
asynchronous help routine to be called.
I would appreciate any comments as to how readable any of this
is. I am seriously considering sending out a more fleshed out
version of this to Data Based Advisor or others as a reasonable
example to others of how Clipper with UDF and VALID can mean
a profoundly different look to data entry screens.